package com.yxy.mapper;

import com.github.pagehelper.Page;
import com.yxy.domain.dto.FeedBackPageQueryDTO;
import com.yxy.domain.po.FeedBack;
import com.yxy.domain.vo.FeedBackPageQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FeedBackMapper {
    /**
     * 插入反馈
     * @param feedBack
     */
    void insert(FeedBack feedBack);

    /**
     * 查询反馈
     * @param feedBackPageQueryDTO
     * @return
     */
    Page<FeedBackPageQueryVO> queryFeedBack(FeedBackPageQueryDTO feedBackPageQueryDTO);

    /**
     * 根据id查询反馈
     * @param id
     * @param userId
     * @return
     */
    @Select("select * from feedback where id = #{id} and user_id = #{userId}")
    FeedBack getFeedbackById(int id, int userId);
}
